<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="点击" onclick="checkRight()" />
已点次数：
<span id="dianjicishu"></span>
<script defer="defer">
    var x=0;
    function checkRight(){
        x=x+1;
        document.getElementById('dianjicishu').innerHTML = x;
    }
</script>
</body>
</html>